{% extends 'base.html' %}

{% block title %}登录 - Neo4j图数据库管理系统{% endblock %}

{% block content %}
<div class="row justify-content-center mt-5">
    <div class="col-md-6">
        <div class="card">
            <div class="card-header">登录</div>
            <div class="card-body">
                {% if error %}
                    <div class="alert alert-danger" role="alert">{{ error }}</div>
                {% endif %}
                {% if request.args.get('success') %}
                    <div class="alert alert-success" role="alert">{{ request.args.get('success') }}</div>
                {% endif %}
                <form method="post" action="{{ url_for('login') }}">
                    <div class="mb-3">
                        <label for="username" class="form-label">用户名</label>
                        <input type="text" class="form-control" id="username" name="username" required>
                    </div>
                    <div class="mb-3">
                        <label for="password" class="form-label">密码</label>
                        <input type="password" class="form-control" id="password" name="password" required>
                    </div>
                    <button type="submit" class="btn btn-primary">登录</button>
                </form>
                <p class="mt-3">还没有账号？<a href="{{ url_for('register') }}">立即注册</a></p>
            </div>
        </div>
    </div>
</div>
{% endblock %}